{% extends "layouts/base.volt" %}

{% block title %}{{ get_title() }}{% endblock %}
{% block content %}
{{ partial("layouts/navbar", ['currentPage': 'admin']) }}
<!-- for beautify -->
{{ partial("layouts/subnavbar")}}
<div class="main">
	
	<div class="main-inner">

	    <div class="container">
	
	      <div class="row">
	      	
	      	<div class="span12">      		
	      		
	      		<div class="widget ">
	      			
	      			<div class="widget-header">
	      				<i class="icon-zoom-in"></i>
	      				<h3>测试</h3>

	  				</div> <!-- /widget-header -->
					
					<div class="widget-content">
						<table class="table table-striped">
						    <thead>
						        <tr>
						          	<th>#</th>
						          	<th>标题</th>
						          	<th>状态</th>
						          	<th>操作</th>
						        </tr>
						    </thead>
						    <tbody>
						    	{% for test in tests %}
						    		<tr>
						    		<th scope="row">{{ test.getId() }}</th>
						    		<td>{{ test.getTitle() }}</td>
						    		{% if test.getStatus() == 0 %}
          								<td>尚未开始答题</td>
          								<td><a href="/admin/setTestBegin/?id={{ test.getId() }}">开启答题</a> | <a href="/admin/setTest/?id={{ test.getId() }}">修改题目</a></td>
          							{% elseif test.getStatus() == 1 %}
          								<td>答题进行中...</td>
          								<td><a href="/admin/setTestClose/?id={{ test.getId() }}">关闭答题</a></td>
          							{% elseif test.getStatus() == 2 %}
          								<td>答题结束</td>
          								<td><a href="/admin/setTestBegin/?id={{ test.getId() }}">开启答题</a></td>
          							{% else %}
          								<td>未知状态</td>
          								<td>无</td>
          							{% endif %}
          							</tr>
          						{% endfor %}
						    </tbody>
						</table>
						
					</div> <!-- /widget-content -->
						
				</div> <!-- /widget -->
	      		
		    </div> <!-- /span8 -->
	      	
	      	
	      	
	      	
	      </div> <!-- /row -->
	
	    </div> <!-- /container -->
	    
	</div> <!-- /main-inner -->
    
</div> <!-- /main -->

{% endblock %}